﻿<?php
/*
 * @Package Softpin Order Manager
 * @Subpackage : sim Manager
 * Create by : thuc.lehuy@gmail.com
 */
defined('_JEXEC') or die('Restricted access');
?>
<div  class="div_sim">
        <div class="componentheading"><div style="float:left;font-size: 15px;"><?php echo $this->title?$this->title:"Kết quả tìm kiếm:"; ?></div><div  style="float:right;color:red;"><b> Tổng cộng có <?php echo $this->total;?> sim</b></div></div>
<?php
    if(!$this->items){
?>
        <div style="background-color: #FFFFFF;height: 40px;padding-top: 10px">
            <p style="color: red;padding-left: 30px;">Chúng tôi rất xin lỗi vì không có sim bạn quan tâm.<br>Mời bạn tìm thêm số khác!</p>
        </div>
    </div>
<?php
    }else{
?>
    <table width="100%" cellspacing="1" cellpadding="5" border="0">
        <thead>
            <tr class="tr_header_sim">
                <th nowrap="nowrap" width="5%">
                    <?php echo JText::_( 'ID' ); ?>
                </th>
                <th nowrap="nowrap" width="25%">
                    <?php echo JText::_( 'Số sim' ); ?>
                </th>
                <th nowrap="nowrap" width="20%">
                    <?php echo JText::_( 'Giá' ); ?>
                </th>
                <th nowrap="nowrap" width="20%">
                    <?php echo JText::_( 'Mạng' ); ?>
                </th>
                <th nowrap="nowrap" width="20%">
                    <?php echo JText::_( 'Loại sim' ); ?>
                </th>                
                <th nowrap="nowrap" width="15%">
                    <?php echo JText::_( 'Mua' ); ?>
                </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                    <td colspan="12">
                            <?php echo $this->pagination->getListFooter(); ?>
                    </td>
            </tr>
        </tfoot>
        <tbody>
        <?php
        $k = 1;
        for ($i=0, $n=count( $this->items ); $i < $n; $i++)
        {
            $row =& $this->items[$i];
            //$checked 	= JHTML::_('grid.id',   $i, $row->sim_id );
            $link = JRoute::_( 'index.php?option=com_sim&task=order&sim_id='.$row->sim_id.'&simnumb='.trim($row->sim_numb));
            ?>
        <tr class="tr_sim">
            <td>
                <?php echo $k+$this->start; ?>
            </td>
            <td>
                <?php //JHTML::_('behavior.modal'); ?>
                <a href="<?php echo $link; ?>" target="_blank"><?php echo $row->sim_numb; ?></a>
            </td>
            <td nowrap="nowrap">
                <?php echo JUtility::thousandseperate($row->price); ?>.000 <?php echo $row->curency; ?>
            </td>
            <td>
                <?php echo $row->provider_name; ?>
            </td>
            <td>
                <?php echo $row->categori_name; ?>
            </td>
            <td>
                <?php JHTML::_('behavior.modal'); ?>
                <?php JHTML::_('behavior.modal'); ?>
                <a rel="{handler: 'iframe', size: {x: 600, y: 400}}" href="<?php echo $link; ?>" class="modal"><img src="images/publish_f2.png" alt="Mời bạn mua sim"/></a>
            </td>
        </tr>
        <?php
        $k =$k+1;
    }
    ?></tbody>
    </table>
    <input type="hidden" name="option" value="com_sim" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="controller" value="sim" />
</div>
<?php }?>